﻿namespace StyleCop.For.ReSharper.TestProject.Documentation
{
    #region Using Directives

    using System;
    using System.Collections.Generic;
    using System.Threading;

    #endregion

    /// <summary>
    /// </summary>
    public class Test1623PropertySummaryDocumentationMustMatchAccessors
    {
        #region Delegates

        /// <inheritdoc />
        public delegate void ButtonEventHandler(object source, int count);

        #endregion
        
        #region Public Properties and Indexers

        /// <summary>
        /// Gets a value indicating whether Enabled.
        /// </summary>
        public bool Enabled { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether EnabledReadOnly.
        /// </summary>
        public bool EnabledReadOnly { get; private set; }

        /// <summary>
        /// Gets or sets TestProperty.
        /// </summary>
        public string TestProperty
        {
            get;
            set;
        }

        public string Test
        {
             get;
             set;
        }

        public string TestSetPrivate
        {
             get;
             private set;
        }

        public string TestNoSet
        {
             get
             {
                  return string.Empty;
             }
        }

        protected string Test2
        {
             get; set;
        }

        protected string Test2SetPrivate
        {
             get;
             private set;
        }

        protected string Test2NoSet
        {
             get
             {
                  return string.Empty;
             }
        }

        internal string Test3
        {
             get;
             set;
        }

        internal string Test3SetPrivate
        {
             get;
             set;
        }

        internal string Test3NoSet
        {
             get
             {
                  return string.Empty;
             }
        }

        private string Test4
        {
             get;
             set;
        }

        private string Test4NoSet
        {
             get
             {
                  return string.Empty;
             }
        }

        protected internal string Test5
        {
             get;
             set;
        }

        protected internal string Test5SetPrivate
        {
             get;
             private set;
        }

        protected internal string Test5NoSet
        {
             get
             {
                  return string.Empty;
             }
        }
        #endregion

        #region Public Methods

        /// <summary>
        /// Test Method to init other properties that are being tested.
        /// </summary>
        public void InitProperties()
        {
             this.TestSetPrivate = string.Empty;
             this.Test2SetPrivate = string.Empty;
             this.Test3SetPrivate = string.Empty;
             this.Test5SetPrivate = string.Empty;
             this.Test4 = this.Test4NoSet;
             this.Test3 = this.Test4;
        }

        public bool TestMethod()
        {
            return true;
        }

        #endregion
        
        /// <summary>
        /// </summary>
        internal class SA1513ClosingCurlyBracketMustBeFollowedByBlankLine
        {
            #region Constants and Fields

            /// <summary>
            /// </summary>
            private bool updated;

            #endregion

            #region Public Properties and Indexers

            /// <summary>
            /// </summary>
            public bool Enabled1
            {
                get
                {
                    var x = 0;
                    do
                    {
                        Console.WriteLine("Loop forever");
                        x++;
                    }
                    while (x < 10);

                    if (this.updated)
                    {
                        return true;
                    }

                    return false;
                }

                set
                {
                    if (value)
                    {
                        this.updated = true;
                    }
                }
            }

            /// <summary>
            /// Gets a value.
            /// </summary>
            public bool Enabled2
            {
                get
                {
                    return true;
                }
            }

            #endregion

            #region Public Methods

            /// <summary>
            /// Object initializers are excluded from this rule.
            /// </summary>
            public void ExcludeObjectInizializerFromThisRule()
            {
                var intArray = new[] { 1, 2, 3 };
                IList<int> intList = new List<int> { 1, 2, 3 };
                intList[0] = intArray[0];
            }

            #endregion
        }
    }
}